<%--
 *  File:    UserGroupEdit.jsp
 *  @Author: Langerwang 
 *  Date:    2001/11/4
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.OvalLabel" %>
<%@ page import="com.oval.util.OvalCustomMessage" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.UserGroupSummary"); 
%>

<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "UPM";
	String privilegeCode = "Z0101,L402";
%>



<%
  	HashMap userInfo = (HashMap)session.getAttribute("userinfo");
  	String strReadOnly = "ReadOnly";
  	String userGroupId = new String("");
  	String strUserGroupName = new String("");
  	String strDescription = new String("");
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>


<html>
<head>
<title>UserGroupEdit</title>
<PageFlow:CheckPageFlow pageName="usergroupedit"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<%@ include file="/inc/InitEdit.inc" %>
<% //--------------------------------------  output variant from pageflow --%>
<%
	Vector allstatus = (Vector)pageContext.getAttribute("allstatus");
  	HashMap userGroupInfo = (HashMap)pageContext.getAttribute("usergroupinfo");

  	if(allstatus == null)
  	{
    	allstatus = new Vector();
  	}
  	if(userGroupInfo == null || userGroupInfo.isEmpty())
  	{
  		strReadOnly = "";
	    userGroupInfo = new HashMap();
  	}  
  	else
  	{
    	userGroupId = (userGroupInfo.get("usergroupid")).toString();
    	strUserGroupName = (String)userGroupInfo.get("usergroupname");
    	strDescription = (String)userGroupInfo.get("description");
  	}    
%>
<script language="JavaScript">
function page_done()
{
  	if(!checkNull(document.usergroupeditform))
  		return;  
  	emptyToNull(document.usergroupeditform);   
  	document.usergroupeditform.actionname.value = "done";
  	isRunning = true;
  	document.usergroupeditform.submit();
}
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
	
	<% //--------------------------------------  hidden form variant --%>
	<form name="usergroupeditform" method="post" action="../../Dispatcher" target="_parent">
  	<input type="hidden" name="pagename" value="usergroupedit">
  	<input type="hidden" name="actionname">  
  	<input type="hidden" name="datelastupdated" value="<%=JspHelper.filterNull( new java.sql.Date(new java.util.Date().getTime()) )%>">                                   
	<input type="hidden" name="orgid" value="<%=JspHelper.filterNull( userInfo.get("orgid") )%>">                                   
	<input type="hidden" name="languagecode" value="<%= strLanguageCode %>">    
	<% if(! userGroupInfo.isEmpty()){ %>
  		<input type="hidden" name="usergroupid" value=<%=JspHelper.filterNull( userGroupId )%>> 
  	<% } %>  
  
  	
  	<% //--------------------------------------  header --%>
	<table width="100%" cellspacing="0" cellpadding="0">
  	<tr> 
    	<td colspan="2" class="summary_top"></td>
  	</tr>
  	<tr> 
    	<td colspan="2"><img src="../../images/<%= strLanguageCode %>/quote.gif" width="16" height="11"> 
		<%= label.getLabelName("L_UpdateUserGroup") + label.getLabelName("L_Colon") %></td>
  	</tr>
	</table>

	<% //--------------------------------------  fields --%>
	<table width="100%" cellspacing="0" cellpadding="0">
    <tr> 
    	<td class="summary_top"> </td>
    </tr>
    <tr>
    	<td valign="top">
        	<table border="1" cellpadding="2" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%">
          	<tr> 
            	<td width="14%" class="need"><%= label.getLabelName("L_UserGroupName") + label.getLabelName("L_Colon")%></td>
            	<td width="86%"> 
              		<input type="text" name="usergroupname" value="<%=JspHelper.filterNull( strUserGroupName)%>" size="16" <%=JspHelper.filterNull( strReadOnly )%> isnull="N" label="<%= message.getMessageDesc("VALUE_NOT_NULL", label.getLabelName("L_UserGroupName",false)) %>">
            	</td>
          	</tr>
          	<tr> 
            	<td class="need" width="14%"><%= label.getLabelName("L_Description") + label.getLabelName("L_Colon") %> </td>
            	<td width="86%"> 
              		<input type="text" name="description" size="40" value="<%=JspHelper.filterNull( strDescription)%>" isnull="N" label="<%= message.getMessageDesc("VALUE_NOT_NULL", label.getLabelName("L_Description",false)) %>">
            	</td>
          	</tr>
          	<tr> 
            	<td class="need" width="14%"><%= label.getLabelName("L_Status") + label.getLabelName("L_Colon") %></td>
            	<td width="86%"> 
            		<oval:select optionsName="allstatus" optionValueKey="statuscode" optionInnerTextKey="statusname" name="usergroupinfo" property="status"/>
         		</td>
          	</tr>
        	</table>
      	</td>
    </tr>
    <tr> 
      	<td class="summary_top"></td>
    </tr>
    
    <% //--------------------------------------  operation button --%>
    <tr> 
      	<td class="td_center"> 
      		<a onclick="page_done()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a>
      	</td>
  	</tr>
  	
	</table>
</form>
</body>
</html>


